<script>
    
 $("#menu ul li ul").hide();
                $("#menu ul li span.current").addClass("open").next("ul").show();
                $("#menu ul li span").click(function(){
                    $(this).next("ul").slideToggle("slow").parent("li").siblings("li").find("ul:visible").slideUp("slow");
                    $("#menu ul li").find("span").removeClass("open");
                    $(this).addClass("open");
                    $.cookie('menu_id',$(this).attr('id'));
                });

</script>
<ul class="nav" > 
    <?php foreach ($listado as $menu): ?>

    <li  ><span id="<?php echo 'men_' . $menu['Menu']['id'] ?>"><a class="link" href="javascript:void(0);" ><?php echo $menu['Menu']['nombre'] ?> </a></span>
            <ul >
                <?php foreach ($menu['Item'] as $item): ?>
                <li class="menu_link" ><?php  echo $ajax->link($item['nombre'] , array('controller'=>$item['controlador'],'action'=>$item['accion']), array('update' => 'content', 'complete' => 'cargar()', 'indicator' => 'loading'))?></li>   <?php endforeach; ?>
            </ul>

        </li>
    <?php endforeach; ?>
</ul>
